Public Class TextBoxNumber
    Inherits TextBox


    Private Sub TextBoxNumber_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles MyBase.KeyPress


    End Sub
    Private Sub KeyDown_Handler(ByVal sender As Object, ByVal e As KeyPressEventArgs) Handles Me.KeyPress
        If Not Char.IsDigit(e.KeyChar) And Not Char.IsControl(e.KeyChar) Then
            e.Handled = True
        End If

        If e.KeyChar.ToString().Equals(".") Then
            If Me.Text.Contains(".") Then
                e.Handled = True
            Else
                e.Handled = False
            End If
        End If
    End Sub
End Class
